package com.example.hrsystem.workflow.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.hrsystem.data.source.DateTypeConverters;

import java.util.Date;

/**
 * 流程实例实体类
 * 代表一个工作流定义的具体执行实例
 */
@Entity(tableName = "process_instances")
public class ProcessInstance {
    @PrimaryKey(autoGenerate = true)
    private int id;

    // 关联的流程定义ID
    private int processDefinitionId;
    
    // 流程实例唯一标识符
    private String instanceKey;
    
    // 流程实例名称
    private String name;
    
    // 流程实例状态 (ACTIVE, COMPLETED, TERMINATED)
    private String status;
    
    // 流程发起人ID
    private int initiatorId;
    
    // 流程启动时间
    @TypeConverters(DateTypeConverters.class)
    private Date startTime;
    
    // 流程结束时间
    @TypeConverters(DateTypeConverters.class)
    private Date endTime;

    // 构造函数
    public ProcessInstance() {}

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProcessDefinitionId() {
        return processDefinitionId;
    }

    public void setProcessDefinitionId(int processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    public String getInstanceKey() {
        return instanceKey;
    }

    public void setInstanceKey(String instanceKey) {
        this.instanceKey = instanceKey;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getInitiatorId() {
        return initiatorId;
    }

    public void setInitiatorId(int initiatorId) {
        this.initiatorId = initiatorId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}